package com.lap.framework.validator.annotation;

import com.lap.framework.validator.FieldMatchValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = FieldMatchValidator.class)
public @interface FieldMatch {

  String message() default "{framework.value.match}";

  Class<?>[] groups() default {};

  Class<? extends Payload>[] payload() default {};

  String sourceField();

  String targetField();

  @Target({ElementType.TYPE})
  @Retention(RetentionPolicy.RUNTIME)
  @interface List {
    FieldMatch[] value();
  }
}
